﻿using Andromeda.Forge.Import.SqlServer;

namespace ForgeIt.Wizards
{
    class ReportProgressObject
    {
        private readonly string _message;
        private readonly int _totalTables;
        private readonly int _totalViews;
        private readonly int _loadedTables;
        private readonly int _loadedViews;
        private readonly VwForgeTablesStub _column;
        private readonly int _totalColumns;
        private readonly int _currentColumn;


        public ReportProgressObject(string message, int totalTables, int totalViews, int loadedTables, int LoadedViews, VwForgeTablesStub column, int totalColumns, int currentColumn)
        {
            _message = message;
            _totalTables = totalTables;
            _totalViews = totalViews;
            _loadedTables = loadedTables;
            _loadedViews = LoadedViews;
            _column = column;
            _totalColumns = totalColumns;
            _currentColumn = currentColumn;
        }

        public int CurrentColumn
        {
            get { return _currentColumn; }
        }

        public int TotalColumns
        {
            get { return _totalColumns; }
        }

        public VwForgeTablesStub Column
        {
            get { return _column; }
        }

        public string Message
        {
            get
            {
                return _message;
            }
        }

        public int ItemCount
        {
            get
            {
                int result = 0;
                if (_totalTables >= 0)
                    result += _totalTables;
                if (_totalViews >= 0)
                    result += _totalViews;
                return result;
            }
        }

        public string TableLoadingStatus
        {
            get
            {
                string result = "";

                if (_totalTables >= 0)
                    result += _totalTables;
                else
                    result += "?";
                result += "/";

                if (_loadedTables >= 0)
                    result += _loadedTables;
                else
                    result += "?";

                return result;
            }
        }

        public string ViewLoadingStatus
        {
            get
            {
                string result = "";

                if (_totalViews >= 0)
                    result += _totalViews;
                else
                    result += "?";
                result += "/";

                if (_loadedViews >= 0)
                    result += (_loadedViews);
                else
                    result += "?";

                return result;
            }
        }
    }
}
